create external table jms_dm.dm_terminal_deliver_punctuality_rate_plan_sum_dt (
   end_agent_code string comment '末端代理区code',
   end_agent_name string comment '末端代理区',
   end_center_code string comment '末端中心code',
   end_center_name string comment '末端中心名字',
   end_city_id string comment '城市id',
   end_city_name string comment '城市名字',
   final_deliver_network_code string comment '派件网点code',
   final_deliver_network_name string comment '派件网点名字',
   end_franchisee_code string comment '末端加盟商code',
   end_franchisee_name string comment '末端加盟商',
   order_source_code string comment '订单来源code',
   order_source_name string comment '订单来源',
   is_common int comment '是否共配',
   need_deliver_count int comment '应派件总量',
   punctuality_sum int comment '及时派件总量',
   one_planned_departure_time string comment '一班规划接件时间',
   one_plan_warehouse_end_time string comment '一班规划出仓时间',
   one_need_deliver_count int comment ' 一班应出仓总量',
   one_punctuality_sum int comment '一班准点出仓量',
   one_delay_30_minutes int comment ' 一班延误30分钟量',
   one_delay_60_minutes int comment '一班延误30分钟量',
   one_delay_120_minutes int comment ' 一班延误120分钟总量',
   two_planned_departure_time string comment '二班规划接件时间',
   two_plan_warehouse_end_time string comment '二班规划出仓时间',
   two_need_deliver_count int comment ' 二班应出仓总量',
   two_punctuality_sum int comment '二班准点出仓量',
   two_delay_30_minutes int comment ' 二班延误30分钟量',
   two_delay_60_minutes int comment '二班延误30分钟量',
   two_delay_120_minutes int comment ' 二班延误120分钟总量',
   is_township int comment '1乡镇 0 非乡镇',
   date_time string comment ' 业务日期',
   deliver_800_count int comment '应派件量',
on_time_deliver_800_count int comment '准点应派件量',
deliver_830_count int comment '应派件量',
on_time_deliver_830_count int comment '准点应派件量',
deliver_900_count int comment '应派件量',
on_time_deliver_900_count int comment '准点应派件量',
       three_planned_departure_time string comment '三班规划接件时间',
       three_plan_warehouse_end_time string comment '三班规划出仓时间',
       three_need_deliver_count int comment'三班应出仓总量' ,
       three_punctuality_sum    int comment'三班准点出仓量',
       three_delay_30_minutes   int comment'三班延误30分钟量',
       three_delay_60_minutes   int comment'三班延误60分钟量',
       three_delay_120_minutes   int comment'三班延误120分钟总量'
) COMMENT '出仓率规划出仓率汇总'
PARTITIONED BY (dt STRING COMMENT '分区')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_terminal_deliver_punctuality_rate_plan_sum_dt'
TBLPROPERTIES (
'discover.partitions'='false',
'parquet.column.index.access'='true'
);
alter table jms_dm.dm_terminal_deliver_punctuality_rate_plan_sum_dt add columns (
        final_sign_user_code string  comment '派件员code'
       ,final_sign_user_name string comment '派件员'
    )cascade ;
